package client.structural.proxy.jdk;

import lombok.extern.log4j.Log4j2;
import lombok.extern.slf4j.Slf4j;
import org.xml.sax.SAXException;
import uml.structural.proxy.jdk.ProxiedInterface;
import uml.structural.proxy.jdk.ProxyClassGenerator;

import javax.xml.parsers.ParserConfigurationException;
import java.io.File;
import java.io.IOException;

/**
 * on 2023/1/9 23:32
 */
@Slf4j
public class Client {
    public static void main(String[] args) throws ParserConfigurationException, IOException, ClassNotFoundException, InstantiationException, IllegalAccessException, SAXException {
        ProxyClassGenerator<ProxiedInterface> pcg =
                new ProxyClassGenerator<ProxiedInterface>(
                        ProxiedInterface.class,
                        new File("src/main/resources/xml/proxy_jdk.xml"),
                        "proxiedClassName");
        ProxiedInterface pi = pcg.generateProxyClassInstance();
        String result=pi.proxiedMethod("sss", 2, 2.1f, 2.2d, 'c');
        log.debug("返回结果：{}",result);
    }
}
